import siderWrapper from 'components/SiderWrapper';
import pageWrapper from 'components/PageWrapper';
import UserManage from './user/UserManage';
import Microservice from './microservice/Microservice';
import Image from './image/Image';
import Message from '../message/Message';

export default function Operation({ match }) {
  const items = [{
    path: `${match.url}/user`,
    iconType: 'user',
    text: '用户管理',
  }, {
    path: `${match.url}/image`,
    iconType: 'file',
    text: '镜像管理',
  }, {
    path: `${match.url}/service`,
    iconType: 'appstore',
    text: '服务管理',
  }];
  const OperationSider = siderWrapper(items);
  const routes = [{
    path: `${match.url}/user`,
    component: UserManage,
  }, {
    path: `${match.url}/service`,
    component: Microservice,
  }, {
    path: `${match.url}/image`,
    component: Image,
  }, {
    path: `${match.url}/message`,
    component: Message,
  }];
  return pageWrapper(OperationSider, routes);
}
